1. Field of the Invention
The present invention relates generally to making JavaScript-based remote function calls from a Web page to one or more remote Web server(s).
2. Description of the Related Art
The Internet is a computer network that provides access to the World Wide Web (“the Web”), a vast collection of pages comprised of text, graphical, multimedia elements, and embedded programs (“client-side scripting”). Graphical user interface programs called Web browsers are employed by Internet users to receive, or download, the Web pages from servers and display the pages at their client computers. A Web browser displays Web pages by showing the text and graphical elements on a client display screen, by playing sound files and showing video sequences, and by running the embedded programs.
The rapid increase in the number of Internet users and in the amount of information being downloaded by users has resulted in high volumes of traffic that overload web servers, as well as increasing delays in downloading Web pages. Delays in downloading and displaying pages make an Internet user's browsing experience less enjoyable. This is especially true for Internet users who do not have high-speed access to the Internet. The response time for the transfer and displaying of page elements between servers and clients could be improved if the amount of data traffic passing over the Internet could be reduced, and more server computing tasks could be offloaded to the clients.
To download a Web page, a user at a client machine requests a Web page by sending a Web page address to the corresponding Web server. A Web page address is specified by a uniform resource locator (URL). When the Web server receives the URL request from a client machine, it determines the format and elements of the requested Web page and constructs a text file according to the hypertext mark-up language (HTML) standard. The HTML file specifies the text to be written and the Web page elements, such as URLs for image files that are to be viewed or displayed, and the format in which they should be presented. The server sends the HTML text file to the client machine, along with any corresponding data files specified by the HTML code.
At the client machine, the user's Internet browser receives the HTML code and automatically renders the page elements, displaying the text data, running the embedded programs, and sending further requests for files specified by URLs in the HTML code. The requests for files may include, for example, image files at servers other than the server from which the original HTML code was received. Thus, it should be apparent that displaying a single Web page may involve many different requests for data and numerous transfers of data between the client machine and one or more Web servers.
One contributor to the excessive Internet traffic that is slowing down the Web is the requirement for reloading of Web pages. Typically, each time a user “visits” a Web page by requesting its contents, that user's Web browser must reload the page data by requesting the entire HTML code and the corresponding data elements. Although some Web pages have a large number of elements that change frequently, it is more typical for a page to be largely static. That is, most of the page elements will not change. The download of Web pages could proceed much more smoothly if more elements of a Web page did not need to be transferred from a server each time the page makes a request.
Once a Web page is downloaded to a client computer's browser, there is no connection maintained with the Web server. In order to communicate with the Web server, the browser must refresh the entire page. This greatly limits how Web pages flow and its design, and results in much redundant data transmission.
The limitations of HTML are most pronounced when moving existing client-server applications to an HTML interface. Suddenly the entire user interface must be reengineered to conform to the page-by-page flow of HTML. Specifically, in bringing client-server applications onto the Web, a lot of unnecessary network traffic is added, and servers are burdened with most of the computing tasks. A better way would be to transfer only the necessary data and offload as many repetitive or resource-consuming computing tasks to the client's computer. Currently, however, Web servers must resend entire Web pages, which include the retransmission of many duplicated page components, and carry out mostly all computing tasks.
There is some effort in trying to fix this flawed Web-based client-server model. The Microsoft Corporation has a technology called “Remote Scripting”, which uses a Java Applet at the Web page acting as a proxy of communication. Now the Web page can either receive more information from the Web server or send information back by calling a function: RSExecute( ) without refreshing the entire page. For detailed information on Microsoft's Remote Scripting, refer to Microsoft's website: http://msdn.microsoft.com/scripting/default.htm?/scripting/RemoteScripting/default.htm. Even after several years of promotion by Microsoft, Remote Scripting technology has not been widely adopted by Web developers. There are several reasons for this:                1. Slow: In order to use Remote Scripting, each Web page must include a Java Applet, acting as the client-side proxy, which must start Java Virtual Machine on the client's computer once the page is loaded. This is a slow process that introduces a 3-8 second delay in displaying the page for most personal computers.        2. Limited Server Compatibility: Remote Scripting only supports Microsoft Web server software, such as Internet Information Server, which must run on a Microsoft operating system, such as NT. Most high traffic and established commercial Websites use some variation of the Unix operating system and non-Microsoft Web server software, such as Apache. Therefore, most high traffic and established commercial websites cannot take advantage of Microsoft's Remote Scripting.        3. Single Server Access: Remote Scripting can only execute remote function calls back to the Web server that originally served the Web page. It cannot therefore make remote function calls to any other Web servers.        
NetGratus, Inc. has already developed several generations of its own Remote Scripting technology that does not require a Java Applet to act as a proxy at the Web page. The previous generation of NetGratus Remote Scripting used a hidden <iframe> element as a proxy on the Web page to make remote JavaScript function calls for Microsoft browsers; it used a hidden <layer> element as a proxy on the Web page to make remote JavaScript function calls for Netscape browsers. The size of the JavaScript library on the client computer side was between 6 to 8 kilobytes. Since NetGratus Remote Scripting does not use a Java Applet as the client-side proxy, there is no loading delay associated with starting the Java Virtual Machine. The other advantage of NetGratus Remote Scripting over Microsoft's Remote Scripting is that it supports many different web server platforms and server operating systems.
The previous generation of NetGratus Remote Scripting still had significant limitations. It could not make remote function calls to other Web server except to the Web server from which that Web page originated from. The main reason this is that the <iframe> and <layer> elements are sub windows of the main Web page, and JavaScript has a security barrier between sub windows and the main window when these windows originate from different Web servers. As a result the main window cannot access data of the child window if the child window came from a different Web server and vice versa. Another side effect is that for every call made through the <iframe>, Internet Explorer adds a record to its history list. So after several remote function calls, several unwanted history records have been recorded, and Web users cannot easily use the “Back” or “Forward” buttons to go to the previous or next Web page.
From the discussion above, it should be apparent that there is a need for better means of making remote function calls from a Web page to remote Web servers. The method for remote function calls from a Web page should be easy to use, compatible with most server platforms, small in size (kilobytes), quick to load, and able to make function calls to multiple Web servers of different origins. The present invention fulfills this need.